package com.cie2.janji.pages.admin;

import java.util.List;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.cie2.janji.base.CieAdminPage;
import com.cie2.janji.entities.BaseEntity;
import com.cie2.janji.entities.PromiseCategory;
import com.cie2.janji.entities.PromiseStatistics;
import com.cie2.janji.services.BaseEntityService;
import com.cie2.janji.services.PromiseStatisticsService;

public class EntityCheck extends CieAdminPage {

	@Property
	private BaseEntity entity;
	
	@Property
	private PromiseStatistics promiseStatistic;

	@Property
	private PromiseCategory promiseCategory;

	// services
	@Inject
	private BaseEntityService baseEntityService;
	
	@Inject
	private PromiseStatisticsService statisticsService;
	
	void onActivate(Long entityId) {
		entity = baseEntityService.load(entityId);

		promiseStatistic = statisticsService.getStatistics(entity);

	}
	
	public List getPCList() {
		return statisticsService.getPC(entity);		
	}
	
	/**
	 * Check if all the report needed for this Entity is allready been created
	 * is it necessary to cover some hole ? 
	 */
	public void checkEntity(BaseEntity entity) {
		
	}
	
	public Boolean promiseStatisticsExist() {
		return Boolean.FALSE;
	}

	public Boolean promiseCategoryExist() {
		return Boolean.FALSE;
	}

}
